<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>ESP8266_RTOS_SDK: WPS APIs</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ESP8266_RTOS_SDK
   &#160;<span id="projectnumber">v1.4.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">WPS APIs<div class="ingroups"><a class="el" href="group__WiFi__APIs.html">WiFi Related APIs</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>ESP8266 WPS APIs.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:gad11410d4ee4246e6b2a7f9b99c958460"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gad11410d4ee4246e6b2a7f9b99c958460"></a>
typedef enum wps_type&#160;</td><td class="memItemRight" valign="bottom"><b>WPS_TYPE_t</b></td></tr>
<tr class="separator:gad11410d4ee4246e6b2a7f9b99c958460"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0da3c16841a4b3b2404577dd8f56251a"><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__WPS__APIs.html#ga0da3c16841a4b3b2404577dd8f56251a">wps_st_cb_t</a>) (int status)</td></tr>
<tr class="memdesc:ga0da3c16841a4b3b2404577dd8f56251a"><td class="mdescLeft">&#160;</td><td class="mdescRight">WPS callback.  <a href="#ga0da3c16841a4b3b2404577dd8f56251a">More...</a><br /></td></tr>
<tr class="separator:ga0da3c16841a4b3b2404577dd8f56251a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:gab033348bcf9347cd8caaa070566b5e36"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab033348bcf9347cd8caaa070566b5e36"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>wps_type</b> { <br />
&#160;&#160;<b>WPS_TYPE_DISABLE</b> = 0, 
<b>WPS_TYPE_PBC</b>, 
<b>WPS_TYPE_PIN</b>, 
<b>WPS_TYPE_DISPLAY</b>, 
<br />
&#160;&#160;<b>WPS_TYPE_MAX</b>
<br />
 }<tr class="separator:gab033348bcf9347cd8caaa070566b5e36"><td class="memSeparator" colspan="2">&#160;</td></tr>
</td></tr>
<tr class="memitem:gad7729ea41405ddb427166e3c6ed9407a"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__WPS__APIs.html#gad7729ea41405ddb427166e3c6ed9407a">wps_cb_status</a> { <br />
&#160;&#160;<a class="el" href="group__WPS__APIs.html#ggad7729ea41405ddb427166e3c6ed9407aac8a6efa900487f4e54f8f09acd2fc4f8">WPS_CB_ST_SUCCESS</a> = 0, 
<a class="el" href="group__WPS__APIs.html#ggad7729ea41405ddb427166e3c6ed9407aa82d6a587f16918a5e08fc7bd72e82256">WPS_CB_ST_FAILED</a>, 
<a class="el" href="group__WPS__APIs.html#ggad7729ea41405ddb427166e3c6ed9407aa06494c31ab495602b84bbf165ecdeffd">WPS_CB_ST_TIMEOUT</a>, 
<a class="el" href="group__WPS__APIs.html#ggad7729ea41405ddb427166e3c6ed9407aabb3484dae0443776c8afe92d23d82621">WPS_CB_ST_WEP</a>, 
<br />
&#160;&#160;<a class="el" href="group__WPS__APIs.html#ggad7729ea41405ddb427166e3c6ed9407aabebbd63e324d7efaaaa19643b6db3c5b">WPS_CB_ST_SCAN_ERR</a>
<br />
 }<tr class="separator:gad7729ea41405ddb427166e3c6ed9407a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga6c3bf6dc44cf11fa735b2d190d9a2861"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__WPS__APIs.html#ga6c3bf6dc44cf11fa735b2d190d9a2861">wifi_wps_enable</a> (WPS_TYPE_t wps_type)</td></tr>
<tr class="memdesc:ga6c3bf6dc44cf11fa735b2d190d9a2861"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable Wi-Fi WPS function.  <a href="#ga6c3bf6dc44cf11fa735b2d190d9a2861">More...</a><br /></td></tr>
<tr class="separator:ga6c3bf6dc44cf11fa735b2d190d9a2861"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaefc2fa1f3e4ba57ff82d41438c20badc"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__WPS__APIs.html#gaefc2fa1f3e4ba57ff82d41438c20badc">wifi_wps_disable</a> (void)</td></tr>
<tr class="memdesc:gaefc2fa1f3e4ba57ff82d41438c20badc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disable Wi-Fi WPS function and release resource it taken.  <a href="#gaefc2fa1f3e4ba57ff82d41438c20badc">More...</a><br /></td></tr>
<tr class="separator:gaefc2fa1f3e4ba57ff82d41438c20badc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad23a740bd3fb80e6f871c78728b4e58b"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__WPS__APIs.html#gad23a740bd3fb80e6f871c78728b4e58b">wifi_wps_start</a> (void)</td></tr>
<tr class="memdesc:gad23a740bd3fb80e6f871c78728b4e58b"><td class="mdescLeft">&#160;</td><td class="mdescRight">WPS starts to work.  <a href="#gad23a740bd3fb80e6f871c78728b4e58b">More...</a><br /></td></tr>
<tr class="separator:gad23a740bd3fb80e6f871c78728b4e58b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga43d54c785288a8ca0689b621f852a443"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__WPS__APIs.html#ga43d54c785288a8ca0689b621f852a443">wifi_set_wps_cb</a> (<a class="el" href="group__WPS__APIs.html#ga0da3c16841a4b3b2404577dd8f56251a">wps_st_cb_t</a> cb)</td></tr>
<tr class="memdesc:ga43d54c785288a8ca0689b621f852a443"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set WPS callback.  <a href="#ga43d54c785288a8ca0689b621f852a443">More...</a><br /></td></tr>
<tr class="separator:ga43d54c785288a8ca0689b621f852a443"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>ESP8266 WPS APIs. </p>
<p>WPS can only be used when ESP8266 station is enabled. </p>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="ga0da3c16841a4b3b2404577dd8f56251a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void(* wps_st_cb_t) (int status)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>WPS callback. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">int</td><td>status : status of WPS, enum wps_cb_status.<ul>
<li>If parameter status == WPS_CB_ST_SUCCESS in WPS callback, it means WPS got AP's information, user can call wifi_wps_disable to disable WPS and release resource, then call wifi_station_connect to connect to target AP.</li>
<li>Otherwise, it means that WPS fail, user can create a timer to retry WPS by wifi_wps_start after a while, or call wifi_wps_disable to disable WPS and release resource.</li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>null </dd></dl>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="gad7729ea41405ddb427166e3c6ed9407a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__WPS__APIs.html#gad7729ea41405ddb427166e3c6ed9407a">wps_cb_status</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="ggad7729ea41405ddb427166e3c6ed9407aac8a6efa900487f4e54f8f09acd2fc4f8"></a>WPS_CB_ST_SUCCESS&#160;</td><td class="fielddoc">
<p>WPS succeed </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggad7729ea41405ddb427166e3c6ed9407aa82d6a587f16918a5e08fc7bd72e82256"></a>WPS_CB_ST_FAILED&#160;</td><td class="fielddoc">
<p>WPS fail </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggad7729ea41405ddb427166e3c6ed9407aa06494c31ab495602b84bbf165ecdeffd"></a>WPS_CB_ST_TIMEOUT&#160;</td><td class="fielddoc">
<p>WPS timeout, fail </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggad7729ea41405ddb427166e3c6ed9407aabb3484dae0443776c8afe92d23d82621"></a>WPS_CB_ST_WEP&#160;</td><td class="fielddoc">
<p>WPS failed because that WEP is not supported </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="ggad7729ea41405ddb427166e3c6ed9407aabebbd63e324d7efaaaa19643b6db3c5b"></a>WPS_CB_ST_SCAN_ERR&#160;</td><td class="fielddoc">
<p>can not find the target WPS AP </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga43d54c785288a8ca0689b621f852a443"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wifi_set_wps_cb </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__WPS__APIs.html#ga0da3c16841a4b3b2404577dd8f56251a">wps_st_cb_t</a>&#160;</td>
          <td class="paramname"><em>cb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set WPS callback. </p>
<dl class="section attention"><dt>Attention</dt><dd>WPS can only be used when ESP8266 station is enabled.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">wps_st_cb_t</td><td>cb : callback.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true : WPS starts to work successfully, but does not mean WPS succeed. </dd>
<dd>
false : fail </dd></dl>

</div>
</div>
<a class="anchor" id="gaefc2fa1f3e4ba57ff82d41438c20badc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wifi_wps_disable </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Disable Wi-Fi WPS function and release resource it taken. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">null</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true : succeed </dd>
<dd>
false : fail </dd></dl>

</div>
</div>
<a class="anchor" id="ga6c3bf6dc44cf11fa735b2d190d9a2861"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wifi_wps_enable </td>
          <td>(</td>
          <td class="paramtype">WPS_TYPE_t&#160;</td>
          <td class="paramname"><em>wps_type</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enable Wi-Fi WPS function. </p>
<dl class="section attention"><dt>Attention</dt><dd>WPS can only be used when ESP8266 station is enabled.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">WPS_TYPE_t</td><td>wps_type : WPS type, so far only WPS_TYPE_PBC is supported</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true : succeed </dd>
<dd>
false : fail </dd></dl>

</div>
</div>
<a class="anchor" id="gad23a740bd3fb80e6f871c78728b4e58b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wifi_wps_start </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>WPS starts to work. </p>
<dl class="section attention"><dt>Attention</dt><dd>WPS can only be used when ESP8266 station is enabled.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">null</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true : WPS starts to work successfully, but does not mean WPS succeed. </dd>
<dd>
false : fail </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Mar 1 2016 10:19:26 for ESP8266_RTOS_SDK by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10
</small></address>
</body>
</html>
